package org.phoenix.mall.admin.config.interceptors;

import org.phoenix.mall.admin.common.utils.PhoenixResponseJSON;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobleExceptionInterceptor {

    @ResponseBody
    @ExceptionHandler(Exception.class)
    public PhoenixResponseJSON handleException(Exception e){
        return PhoenixResponseJSON.errorMsg(e.getMessage());
    }
}
